/**
 * 文件封装模块
 */

//本地储存获取模块W
export const getItem = name =>{
    try {
        return JSON.parse(window.localStorage.getItem(name))
    } catch (err) {
        return window.localStorage.getItem(name)
    }
}


//本地储存模块
export const setItem = (name,value)=>{
    if(typeof value === 'object'){
        window.localStorage.setItem(name,JSON.stringify(value))
    }else{
        window.localStorage.setItem(name, value)
    }
    
}


//本地储存删除模块
export const removeItem = name =>{
    window.localStorage.removeItem(name)
}